package com.gqj.bas.mapper;

import com.gqj.bas.domain.BasWarehouse;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 仓库Mapper接口
 * 
 * @author lxq
 * @date 2023-12-17
 */
public interface BasWarehouseMapper 
{
    /**
     * 查询仓库
     * 
     * @param warehouseId 仓库主键
     * @return 仓库
     */
    public BasWarehouse selectBasWarehouseByWarehouseId(Long warehouseId);

    /**
     * 查询用户列表
     * 
     * @param basWarehouse 仓库
     * @return 仓库集合
     */
    public List<Map<String, Object>> userOptions(BasWarehouse basWarehouse);

    /**
     * 查询仓库列表
     *
     * @param basWarehouse 仓库
     * @return 仓库集合
     */
    public List<BasWarehouse> selectBasWarehouseList(BasWarehouse basWarehouse);

    /**
     * 新增仓库
     * 
     * @param basWarehouse 仓库
     * @return 结果
     */
    public int insertBasWarehouse(BasWarehouse basWarehouse);

    /**
     * 修改仓库
     * 
     * @param basWarehouse 仓库
     * @return 结果
     */
    public int updateBasWarehouse(BasWarehouse basWarehouse);

    /**
     * 删除仓库
     * 
     * @param warehouseId 仓库主键
     * @return 结果
     */
    public int deleteBasWarehouseByWarehouseId(Long warehouseId);

    /**
     * 批量删除仓库
     * 
     * @param warehouseIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteBasWarehouseByWarehouseIds(Long[] warehouseIds);

    /**
     * 校验库房名称是否唯一
     *
     * @param warehouseName 库房名称
     * @return 结果
     */
    public BasWarehouse checkWarehouseNameUnique(@Param("warehouseName") String warehouseName);

    /**
     * 查询库房是否被引用
     *
     * @param warehouseId 库房ID
     */
    public int checkMaterialExistWarehouse(Long warehouseId);

    /**
     * 查询库房是否被引用
     *
     * @param warehouseId 库房ID
     */
    public int checkDeviceExistWarehouse(Long warehouseId);

    /**
     * 查询仓库下拉框
     *
     * @param basWarehouse 仓库
     * @return 仓库集合
     */
    public List<Map<String, Object>> warehouseOptions(BasWarehouse basWarehouse);
}
